package com.kl.feign;

import com.kl.domain.DetailedDTO;
import com.kl.domain.OrderDTO;
import com.kl.em.Result;
import com.kl.feign.fallback.CreatOrderServiceFeignFallback;
import com.kl.feign.fallback.FreightServiceFeignFallback;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

//下单,运单,alipay freight接口
@FeignClient(value = "kunlun-creatorder-service-a",fallback = CreatOrderServiceFeignFallback.class)//服务名找项目
public interface CreatOrderServiceFeign {
    //下订单
    @PostMapping("/order/cdorder")
    Result add(@RequestBody List<OrderDTO> orderDTO);
    //通过订单id支付这个订单
    @GetMapping("/order/pay")
    Result pay(@RequestParam Long id);
    //下运单 传订单id
    @PostMapping("/order/waybill")
    Result waybill(@RequestParam Long orderId);

    //根据运单id 查询明细
    @GetMapping("/detailed/getWaybillId")
    Result<List<DetailedDTO>> findDetailById(@RequestParam Long waybillId);
}
